package com.nononsenseapps.feeder.ui.home

import android.view.View
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.nononsenseapps.feeder.model.FeedUnreadCount
import com.nononsenseapps.feeder.ui.R

open class AbstractFavoriteHolder(val feedID:Long, val onNavigationItemClickListener: OnNavigationItemClickListener, v: View) : RecyclerView.ViewHolder(v), View.OnClickListener {

    val title: TextView = v.findViewById(R.id.feed_name)
    val unreadCount: TextView = v.findViewById(R.id.feed_unreadcount)
    var item: FeedUnreadCount? = null

    init {
        v.setOnClickListener(this)
    }

    /**
     * Called when a view has been clicked.
     *
     * @param v The view that was clicked.
     */
    override fun onClick(v: View) {
        onNavigationItemClickListener.onNavigationItemClick(
                feedID, null, null, null
        )
    }
}